home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet internetowy / Czytniki RSS / RSS Bandit 1.3.0.42 / RssBandit Installer.msi / _172FF5180BC61D3C6D240F14338A23AA / _BB07147B49924BABA8BD78BC0E4B300E < prev    next >
Extensible Markup Language  |  2004-12-30  |  5KB  |  211 lines

  1. <?xml version="1.0"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/rss/1.0/" xmlns:fd="http://www.bradsoft.com/feeddemon/xmlns/1.0/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">
  3. <xsl:output method="html"/>
  4.  
  5.  
  6. <xsl:variable name="common-styles">
  7. <style type="text/css">
  8.  
  9. body {
  10.     font-family: Comic Sans MS;
  11.     background-color: #DEDCD8; }
  12.  
  13. div.channeltitle,
  14. div.newsitem {
  15.     display: inline;
  16.     width: 410px;
  17.     height: 410px;
  18.     position: relative;
  19.  
  20.     border: 3px solid gray;
  21.     margin: 20px 20px 20px 20px;
  22.     filter: progid:DXImageTransform.Microsoft.Shadow(direction=135,strength=6);
  23.     background-color: white; }
  24.  
  25. div.channeltitle {
  26.     display: block;
  27.     width: 50%;
  28.     height: 40px;
  29.     overflow: visible;
  30.  
  31.     padding: 10px 10px 10px 10px;
  32.     
  33.     font-size: 160%;
  34.     text-align: center; }
  35.  
  36. div.readnewsitemcontent,
  37. div.flaggednewsitemcontent,
  38. div.newsitemcontent {
  39.     display: block;
  40.     overflow: auto;
  41.     width: 370px;
  42.     height: 320px;
  43.  
  44.     border: 1px solid gray;
  45.     margin: 2px 20px 20px 20px;
  46.     padding: 10px 10px 10px 10px;
  47.     background-color: #F8F8FF;
  48.     scrollbar-base-color: #F8F8FF;
  49.     scrollbar-3dlight-color: gray;
  50.     scrollbar-shadow-color: white;
  51.     scrollbar-arrow-color: gray;
  52.     scrollbar-face-color: #F0F0FF;
  53.  
  54.     font-size: 80%; }
  55.  
  56. div.readnewsitemcontent { 
  57.     background-color: #DEDCD8; 
  58.     scrollbar-base-color: #DEDCD8;
  59.     scrollbar-face-color: #D2D0D0; }
  60.  
  61. div.flaggednewsitemcontent { 
  62.     background-color: #FF9999; 
  63.     scrollbar-base-color: #FF9999;
  64.     scrollbar-face-color: #FFA0A0; }
  65.  
  66.  
  67. div.newsitemtitle {
  68.     display: block;
  69.     overflow: visible;    
  70.     height: 80px;
  71.  
  72.     padding: 0px 20px 20px 20px;
  73.  
  74.     font-size: 140%;
  75.     text-align: center; }
  76.  
  77. div.newsitemdate {
  78.     display: block;
  79.     padding: 3px 15px 0px 15px;
  80.  
  81.     text-align: right;
  82.     font-size: 75%;
  83.     color: gray; }
  84.  
  85. div.newsitemdate a,
  86. div.newsitemtitle a,
  87. div.channeltitle a {
  88.     text-decoration: none;
  89.     color: black;
  90.     font-family: Comic Sans MS; }
  91.  
  92. blockquote { 
  93.     margin-left: 20px; 
  94.     margin-right: 20px; }
  95.  
  96. i,
  97. em { font-style: normal;    }
  98.  
  99. code, 
  100. pre, 
  101. tt { font-size: 90%; }
  102.  
  103. a { color: black; }
  104.  
  105. a:hover { color: blue; }
  106.  
  107. a img { border: 1px solid black; }
  108.  
  109. a:hover img { border: 1px solid blue; }
  110.  
  111. </style>
  112. </xsl:variable>
  113.  
  114. <xsl:variable name="AdditionalStyles">
  115. <style type="text/css">
  116.  
  117. div.newsitem {
  118.     width: 615px;
  119.     height: 615px; }
  120.  
  121. div.readnewsitemcontent,
  122. div.flaggednewsitemcontent,
  123. div.newsitemcontent {
  124.     width: 570px;
  125.     height: 480px; }
  126.  
  127. </style>
  128. </xsl:variable>
  129.  
  130. <!-- newsitem  -->
  131. <xsl:template match="item">
  132.     <div class="newsitem">
  133.         <div class="newsitemdate">
  134.         <xsl:if test="/newspaper/@type='newsitem'">
  135.         <!-- 
  136.             Important: use 'source' element here so that source channel shows for 
  137.             newsbins and watches.  For other channels, FeedDemon sets the source
  138.             to the channel itself.
  139.         -->
  140.                 Source: <a href="{source/@htmlUrl}">
  141.                             <xsl:value-of select="source" disable-output-escaping="yes"/>
  142.                         </a>
  143.                 |
  144.                 <a href="{source/@url}">RSS</a> |
  145.         </xsl:if>
  146.             <xsl:value-of select="fd:dateDisplay"/>
  147.         </div>
  148.         <div class="newsitemcontent">
  149.         <xsl:if test="fd:state[@read='1']">
  150.             <xsl:attribute name="class">readnewsitemcontent</xsl:attribute>
  151.         </xsl:if>
  152.         <xsl:if test="fd:state[@flagged='1']">
  153.             <xsl:attribute name="class">flaggednewsitemcontent</xsl:attribute>
  154.         </xsl:if>
  155.             <xsl:value-of select="description" disable-output-escaping="yes"/>
  156.         </div>
  157.         <div class="newsitemtitle">
  158.             <a href="{link}"  title="Click to open the newsitem's link. Hold SHIFT to open it in a new window">
  159.                 <xsl:attribute name="class"><xsl:choose><xsl:when test="fd:state[@flagged='1']">flagged</xsl:when><xsl:when test="fd:state[@read='1']">read</xsl:when></xsl:choose></xsl:attribute>
  160.                 <xsl:value-of select="title" disable-output-escaping="yes"/>
  161.             </a>
  162.         </div>
  163.     </div>
  164. </xsl:template>
  165. <!-- channel  -->
  166. <xsl:template match="channel">
  167.     <center>
  168.     <div class="channeltitle">
  169.         <a href="{link}"  title="Click to open the channel's homepage. Hold SHIFT to open it in a new window">
  170.             <xsl:value-of select="title"/>
  171.         </a>
  172.     </div>
  173.     </center>
  174.     <xsl:for-each select="item">
  175.         <xsl:sort select="fd:sortKey" data-type="number" order="ascending"/>
  176.         <xsl:apply-templates select="."/>
  177.     </xsl:for-each>
  178. </xsl:template>
  179. <!-- channel/group newspaper -->
  180. <xsl:template match="newspaper[@type='group' or @type='channel']">
  181.     <html>
  182.         <head>
  183.             <title>Group/Channel Newspaper</title>
  184.             <base href="{//channel[1]/link}" />
  185.             <xsl:copy-of select="$common-styles"/>
  186.         </head>
  187.         <body>
  188.             <xsl:for-each select="channel">
  189.                 <xsl:apply-templates select="."/>
  190.             </xsl:for-each>
  191.         </body>
  192.     </html>
  193. </xsl:template>
  194. <!-- single news item -->
  195. <xsl:template match="newspaper[@type='newsitem']">
  196.     <html>
  197.         <head>
  198.             <title>News Item</title>
  199.             <base href="{//item/link}" />
  200.             <xsl:copy-of select="$common-styles"/>
  201.             <xsl:copy-of select="$AdditionalStyles"/>
  202.         </head>
  203.         <body>
  204.             <xsl:for-each select="channel/item">
  205.                 <xsl:apply-templates select="."/>
  206.             </xsl:for-each>
  207.         </body>
  208.     </html>
  209. </xsl:template>
  210. </xsl:stylesheet>
  211.